Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle SIGTERM and signals from user space #57

Merged
merged 182 commits into from
Jul 21, 2024
Merged

Conversation

rustworthy
Copy link
Collaborator

@rustworthy rustworthy commented Mar 21, 2024

As per #4


This change is Reviewable

@rustworthy
Copy link
Collaborator Author

@jonhoo I think all the threads have been addressed.

I thing that I have just realized is that we do not allow to Worker::run a terminated worker, and we drop the processing workers we have spawned, but Worker::run_one is still possible since the coordinating worker is not dropped.

Imagine the situation where the server told us to stop the consumption (we get this message in the heartbeat task on the coordinator), and we do so and mark the coordinator as terminated. What they can do then is take this worker and call run_one in a loop mimicking this way the Worker::run logic, but without HEARTBEATing and - most importantly - breaking the server instruction we've received previously. I think this is not something we want to be possible, wdyt?

@rustworthy rustworthy requested a review from jonhoo July 19, 2024 06:29
src/worker/stop.rs Outdated Show resolved Hide resolved
src/worker/stop.rs Outdated Show resolved Hide resolved
src/worker/stop.rs Outdated Show resolved Hide resolved
src/worker/mod.rs Outdated Show resolved Hide resolved
Copy link
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it's a good point. I think I agree that run_one also shouldn't be possible once terminated 👍

@rustworthy rustworthy requested a review from jonhoo July 21, 2024 08:23
@jonhoo jonhoo merged commit a63b658 into main Jul 21, 2024
19 checks passed
@rustworthy rustworthy deleted the feat/sigterm-handling branch August 9, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants